<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%@include file="../common.jsp"%>
    <title>app管理</title>
	<meta http-equiv="cache-control" content="no-cache">
	<link rel="stylesheet" type="text/css" href="resources/css/common.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta http-equiv="X-UA-Compatible" content="IE=9" />

<link href="resources/css/bootstrap/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="resources/css/jquery.fileupload.css">
<link rel="stylesheet" href="resources/css/jquery.fileupload-ui.css">

<script src="resources/js/jquery.ui.widget.js"></script> 
<script src="resources/js/jquery.fileupload.js"></script>
<script src="resources/js/jquery.iframe-transport.js"></script> 

</head>
<body>
	<div class="row fileupload-buttonbar" style="padding-left:15px;">
		<div class="thumbnail col-sm-6">
			<!-- <img id="weixin_show" style="height:180px;margin-top:10px;margin-bottom:8px;"  src="__PUBLIC__/images/game/game_1.png" data-holder-rendered="true">  
 -->
			<div class="progress progress-striped active" role="progressbar"
				aria-valuemin="10" aria-valuemax="100" aria-valuenow="0">
				<div id="weixin_progress" class="progress-bar progress-bar-success"
					style="width:0%;"></div>
			</div>
			<div class="caption" align="center">
				<span id="weixin_upload" class="btn btn-primary fileinput-button">
					<span>上传</span> <input type="file" id="myFile" name="myFile"
					multiple> </span> <a id="weixin_cancle" href="javascript:void(0)"
					class="btn btn-warning" role="button"
					onclick="cancleUpload('weixin')" style="display:none">删除</a> <span
					class="btn btn-warning" id="ase">暂停</span>
			</div>
		</div>
	</div>

	<script>
		$(function() {
			$("#myFile").fileupload({
				url : 'upload/doUpload',
				limitConcurrentUploads : 1,
				sequentialUploads : true,
				progressInterval : 100,
				maxChunkSize : 1000, //设置上传片段大小，不设置则为整个文件上传
				dataType : "json"

			}).bind(
					'fileuploadprogress',
					function(e, data) {
						var progress = parseInt(data.loaded / data.total * 100,
								10) - 1;
						$("#weixin_progress").css('width', progress + '%');
						$("#weixin_progress").html(progress + '%');
					}).bind('fileuploaddone', function(e, data) {
				$("#weixin_progress").css('width', 100 + '%');
				$("#weixin_progress").html(100 + '%');
				 $("#weixin_show").attr("src","resource/"+data.result);  
				 $("#weixin_upload").css({
					display : "none"
				});
				$("#weixin_cancle").css({
					display : ""
				});
			}).bind('fileuploadpaste', function(e, data) {
				alert("aaa");
			});
		});
	</script>
</body>


</html>